//设备新增
import commonRequest from '/@/api/common/common';
import { i18n } from '/@/locales/i18n';
const $t = i18n.global.t;

export default function (data: any, state: any) {
	const array = [
		{
			type: 'select',
			label: $t('kJu7Trhi2W73OAVloSf'),
			key: 'n_ProjectId',
			value: data.v_ProjectName || '',
			placeHolder: $t('ehhbmuhU8y6pDtkJzLPh'),
			selectOption: {
				type: 'remote',
				loading: false,
				requestMethod: commonRequest.getProjectList,
				searchKey: 'SearchValue',
				value: 'n_Id',
				label: 'v_ItemProjectName',
			},
			rules: [{ required: true, message: $t('key_0'), trigger: ['blur', 'change'] }],
			disabledStyle: state,
		},
		{
			type: 'select',
			label: $t('ebd7Jl2fPx6WeiyWryLYl'),
			key: 'n_AccidentType',
			value: data.n_AccidentType || 4,
			options: [
				{
					label: $t('6OXRd46kqWcjgKWikLab'),
					value: 1,
				},
				{
					label: $t('v3z9u2qGz6rkAiKlOMqmw'),
					value: 2,
				},
				{
					label: $t('mou2x2mSTasl8p_6V93Oc'),
					value: 3,
				},
				{
					label: $t('bgVvcSvUalDBrkLfHmMgm'),
					value: 4,
				},
			],
			placeHolder: $t('vFqaSa26GxAt5qgUhQ69'),
			rules: [{ required: true, message: $t('x6UPsHYyX7VdDyxbT1nsI'), trigger: 'change' }],
			disabledStyle: state,
		},
		{
			type: 'select',
			label: $t('wSVbiC90l3Cz2vgZDpH1'),
			key: 'accientEmp',
			value: data.accientEmps || '',
			placeHolder: $t('ehhbmuhU8y6pDtkJzLPh'),
			selectOption: {
				type: 'remote',
				loading: false,
				requestMethod: commonRequest.getUserList,
				searchKey: 'EmpName',
				value: 'name',
				label: 'name',
				multiple: true,
				collapseTags: true,
				otherParams: {
					IsChoose: false,
				},
			},
			rules: [{ required: true, message: $t('key_0'), trigger: ['change'] }],
			disabledStyle: state,
		},
		{
			type: 'select',
			label: $t('key_1'),
			key: 'n_BlameEmp',
			value: data.v_BlameEmpName || '',
			placeHolder: $t('ehhbmuhU8y6pDtkJzLPh'),
			selectOption: {
				type: 'remote',
				loading: false,
				requestMethod: commonRequest.getUserList,
				searchKey: 'EmpName',
				value: 'id',
				label: 'name',
				otherParams: {
					IsChoose: false,
				},
			},
			rules: [{ required: true, message: $t('key_0'), trigger: ['blur', 'change'] }],
			disabledStyle: state,
		},

		{
			type: 'date',
			label: $t('xGf8UlmsOfLRtI3eMt8t'),
			key: 'd_AccidentTime',
			value: data.d_AccidentTime || '',
			placeholder: $t('xUuIxjDxMKrGxHa2oZw20'),
			//选择一个日期时间
			dateOption: {
				type: 'datetime',
				format: 'YYYY-MM-DD HH:mm:ss',
			},
			rules: [{ required: true, message: $t('key_0'), trigger: ['blur', 'change'] }],
			disabledStyle: state,
		},
		{
			type: 'input',
			label: $t('y6QHqZ8Ej6hFlDqPaxBnj'),
			key: 'v_AccidentAddress',
			value: data.v_AccidentAddress || '',
			rules: [{ required: true, message: $t('dRMoJAvogb9PLbSoUwe41'), trigger: ['blur', 'change'] }],
			placeHolder: $t('ylAb0rtD2vwKwtFi8yKi'),
			disabledStyle: state,
		},
		{
			type: 'select',
			label: $t('lshdti_8JrDFbMEdiiS7O'),
			key: 'n_AccidentLevel',
			value: data.n_AccidentLevel || 4,
			options: [
				{
					label: $t('ergqfyNSpLgNxuuD7GyAz'),
					value: 1,
				},
				{
					label: $t('oglxx6bPsV5ZSbNsuceBs'),
					value: 2,
				},
				{
					label: $t('oPywhZlVTzfbU7zyP3io'),
					value: 3,
				},
				{
					label: $t('dgNnBtN1BUk1ZjMEum4bH'),
					value: 4,
				},
			],
			placeHolder: $t('sg6rdxVjaOje5kMgJrW'),
			rules: [{ required: true, message: $t('tev3Blicc3u7ZMLmVfPw'), trigger: 'change' }],
			disabledStyle: state,
		},

		{
			type: 'textarea',
			label: $t('gp1q0UYvaheSr_2ZfIo'),
			key: 'v_AfterContent',
			value: data.v_AfterContent || '',
			rules: [{ required: true, message: $t('dRMoJAvogb9PLbSoUwe41'), trigger: ['blur', 'change'] }],
			placeHolder: $t('el9zQuVkGGeLmUqsRoVad'),
			disabledStyle: state,
		},
		{
			type: 'textarea',
			label: $t('5vrjAWl3Exbq1dpiMgOh'),
			key: 'v_HandleMeasure',
			value: data.v_HandleMeasure || '',
			placeHolder: '',
			disabledStyle: state,
		},

		{
			type: 'textarea',
			label: $t('9RLaVEiJf1Z1Qv15o6Kll'),
			key: 'v_Remark',
			value: data.v_Remark || '',
			disabledStyle: state,
		},
		{
			type: 'slot',
			slotName: 'tint1',
			label: $t('s4KbtSrTfOzuWyRcHgTxx'),
			size: {
				xs: 24,
				sm: 24,
				md: 24,
				lg: 24,
				xl: 24,
			},
		},
		{
			type: 'slot',
			slotName: 'File',
			size: {
				xs: 24,
				sm: 24,
				md: 24,
				lg: 24,
				xl: 24,
			},
		},
		{
			type: 'slot',
			slotName: 'Detail',
			size: {
				xs: 24,
				sm: 24,
				md: 24,
				lg: 24,
				xl: 24,
			},
		},
	];
	return array;
}
